package routers

import (
	"sale-admin/internal/app/web/controller"
	"sale-admin/internal/app/web/middleware"

	"github.com/gin-gonic/gin"
)

func Default(router *gin.Engine) {
	router.Use(middleware.RecoveryMiddleware())
	
	/*健康检查*/
	router.GET("/health", func(c *gin.Context) {
		c.JSON(200, "ok")
	})

	// 免认证
	RobotRouter(router.Group("/robot"))
	PublicRouter(router.Group("/public"))

	// 免认证之admin相关
	router.POST("/admin/pay/AliPay_Test", controller.Pay{}.AliPayNativePay)                        // 支付宝支付测试
	router.POST("/admin/pay/alipay-micropay-init", controller.Pay{}.AliPayMicropayInit)            // 支付宝人脸初始化
	router.POST("/admin/pay/alipay-micropay", controller.Pay{}.AliPayMicropay)                     // 支付宝人脸支付
	router.POST("/admin/pay/alipay-refund", controller.Pay{}.AlipayRefund)                         // 支付宝退款
	router.POST("/admin/pay/alipay-query", controller.Pay{}.AliPayQuery)                           // 支付宝退款
	router.POST("/admin/pay/Dx_test_sales", controller.Pay{}.DaxingPay)                            // 大兴支付测试
	router.POST("/admin/pay/Dx_test_query", controller.Pay{}.DaxingQuery)                          // 大兴支付查询测试
	router.POST("/admin/pay/daxing-refund", controller.Pay{}.DaxingRefund)                         // 大兴支付退款
	router.POST("/admin/pay/register", controller.Pay{}.Xinzhe)                                    // 新哲教育 — — 注册送优惠码
	router.POST("/admin/pay/register_of_look", controller.Pay{}.Look)                              // 大道问卷调查 — — 注册送优惠码
	router.POST("/admin/pay/SendCms", controller.Pay{}.SendCms)                                    // 发送短信验证码
	router.POST("/admin/pay/wechat-notify", controller.Pay{}.WechatNotify)                         // 微信支付回调地址
	router.POST("/admin/pay/wechat-v3-notify", controller.Pay{}.WechatV3Notify)                    // 微信支付回调地址
	router.POST("/admin/pay/wechat-v3-complaint-notify", controller.Pay{}.WechatV3ComplaintNotify) // 微信支付投诉通知回调地址
	router.POST("/admin/pay/alipay-notify", controller.Pay{}.AlipayNotify)                         // 支付宝支付回调地址
	router.GET("/admin/pay/stripe-pay", controller.Pay{}.StripePay)                                // stripe支付
	router.GET("/admin/pay/stripe-success", controller.Pay{}.StripeSuccess)                        // stripe支付成功回调
	router.GET("/admin/pay/stripe-ex-success", controller.Pay{}.StripeExSuccess)                   // stripe_ex 支付成功
	router.POST("/admin/pay/stripe-ex-webhook", controller.Pay{}.StripeExWebhook)                  // stripe_ex webhook回调
	router.POST("/admin/pay/yongwang-pay", controller.Pay{}.YongWangPay)                           // 永旺支付
	//
	router.POST("/public/activity/detail", controller.Activity{}.Detail)    //获取活动详情
	router.POST("/public/activity/add_data", controller.Activity{}.AddData) //提交客户资料

	// 需要认证
	AdminRouter(router.Group("/admin"))
	AdminRouterV2(router.Group("/v2/admin"))
	WebRouter(router.Group("/web"))
	APIRouter(router.Group("/api"))          // 婚博会 - 获取兑换码
	OpenAPIRouter(router.Group("/open-api")) //对外提供的开放接口，需要商户的apitoken校验获取合法性
	NonauthRouter(router.Group("/nonauth"))
}
